<?php

/**
 * Subclass for representing a row from the 'consulta' table.
 *
 * 
 *
 * @package lib.model
 */ 
class Consulta extends BaseConsulta
{
	public $objestudiante='';
	public $numeroFinal='';

	function getNumeroFinal()
	{
	 if ($this->numeroFinal == '')
	 {
	 	$c = new Criteria();
	 	$c->addDescendingOrderByColumn('id');
	 	$consulta = ConsultaPeer::doSelectOne($c);
    	$num= $consulta->getId();
    	$num++;
     
	 }  
       $numero_c="CNS".$num;
       $this->numeroFinal= (string)$numero_c;
       
       return  $this->numeroFinal;		

	}	
	
	
  public function getObjestudiante($cedula)
	{
	
    if ($this->objestudiante=='')
    {
	 
	 $c = new Criteria();
     $c->add(EstudiantePeer::CEDULA,$cedula);
     $this->objestudiante = EstudiantePeer::doSelectOne($c);
	  }	
	return $objestudiante;
	}
	
	
}
